﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TextDemo.Controllers
{
    public class StudentController : Controller
    {
        // GET: Student
        public ActionResult Index()
        {
            ViewBag.PageTitle = "你好";
            return View();
        }
        
        public ActionResult List()
        {
            List<Student>studentList = new List<Student>();
            for(i=0;i<=5;i++)
            {
                var sta=new Student{Name=string.Format("学生{0}",i),Age=50};
                studentList.Add(stu);
            }
            ViewBag.List=studentList;
            return View();
        }
    }
   public class Student
     {
        public string Name{get; set;}
        public int Age{get;set;}
     }
}